package com.itcat.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.itcat.api.mysql.SmsHomeNewProductApi;
import com.itcat.mysql.pojo.SmsHomeNewProduct;
import com.itcat.service.SmsHomeNewProductService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * 首页新品推荐管理Service实现类
 * Created by macro on 2018/11/6.
 */

@Service
public class SmsHomeNewProductServiceImpl implements SmsHomeNewProductService {

    @DubboReference
    private SmsHomeNewProductApi smsHomeNewProductApi;

    @Override
    public Page<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
        Page<SmsHomeNewProduct> list = smsHomeNewProductApi.list(productName, recommendStatus, pageSize, pageNum);
        return list;
    }

    @Override
    public void create(List<SmsHomeNewProduct> smsHomeNewProducts) {
        smsHomeNewProductApi.create(smsHomeNewProducts);
    }

    @Override
    public void delete(List<Integer> ids) {
        smsHomeNewProductApi.delete(ids);
    }

    @Override
    public void updateRecommendStatus(List<Integer> ids, Integer recommendStatus) {
        smsHomeNewProductApi.updateRecommendStatus(ids,recommendStatus);
    }

    @Override
    public void updateSort(Integer id, Integer sort) {
        smsHomeNewProductApi.updateSort(id,sort);
    }


}
